package com.sumainfor.pc.cfo.service.impl;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.cfo.dao.FinancialAssistantMapper;
import com.sumainfor.pc.cfo.feign.extend.GmioFeign;
import com.sumainfor.pc.cfo.service.FinancialAssistantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 *财务助理
 * <p>
 *
 * @author: zhoucong
 * @create: 2019-07-02 21:12
 **/
@Service
public class FinancialAssistantServiceImpl implements FinancialAssistantService {

    @Autowired
    FinancialAssistantMapper financialAssistantMapper;

    @Autowired
    GmioFeign gmioFeign;

    /**
     * 重要状态提醒
     * @author zhoucong
     * @data 2019/7/2
     * @Param
     * @return
     */
    @Override
    public JsonResult getImport() {
        JsonResult result = new JsonResult();
        JsonResult gmioResult = gmioFeign.getTheOwnerRent();
        Map<String,Object> gmioMap = (Map<String, Object>) gmioResult.get("result");
        Map<String,Object> getImportMap = financialAssistantMapper.getImport();
        getImportMap.putAll(gmioMap);
        return result.put(getImportMap);
    }

}
